package com.bckj.freshnow.order.mapper;

import com.bckj.freshnow.order.entity.TradeBillInfo;
import com.bckj.freshnow.order.model.TradeBillInfoResponse;
import com.bckj.freshnow.order.model.TradeBillInfoRequest;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.jdbc.SQL;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;

/**
 * 交易订单账单信息表(TradeBillInfo)表数据库访问层
 *
 * @author makejava
 * @since 2025-04-22 14:59:23
 */
@Mapper
public interface TradeBillInfoMapper extends BaseMapper<TradeBillInfo> {

    /**
      * 列表
      *
      * @param request req
      * @return list
      */
    @SelectProvider(method = "findAll" , type = TradeBillInfoProvider.class)
    List<TradeBillInfoResponse> findAll(TradeBillInfoRequest request);
    
    class TradeBillInfoProvider{
        
        public String findAll(TradeBillInfoRequest request){
            SQL sql = new SQL();
            sql.SELECT("id, order_id, is_parent, bill_status, bill_type, bill_amount, discount_amount, payable_amount, paid_amount, refunded_amount, pending_amount, is_deleted, version, update_time, create_time");
            sql.FROM("trade_bill_info");
            return sql.toString();
        }
    }
}

